<?php
namespace App\Repositories\Seek;

use App\Models\Seek\FindImages;
use App\Repositories\BaseRepository;
use App\Exceptions\OrdinaryException;

class FindImagesRepository extends BaseRepository {

    public function model()
    {
        // TODO: Implement model() method.
        return FindImages::class;
    }

    /**
     * 插入图片表
     *
     * @author zx
     * @date 2019-01-25
     * @param array $data 参数包
     * @param int $nid 需求关联ID
     * @return Boolean
     */
    public function addImages(array $data, int $nid)
    {
        $arr = [];
        foreach($data['imgArr'] as $key => $val){
            $arr[$key] = [
                'url' => $val,
                'out_id' => $nid
            ];
        }
        return $this->createMultiple($arr);
    }

    public function serialization(array $attributes)
    {
        // TODO: Implement serialization() method.
    }

}